package com.atguigu.tingshu.user.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
@RequestMapping("/api/user/userInfo/inner")
public class UserInfoControllerRpc {

    @Autowired
    UserInfoService userInfoService;

    @GetMapping("/getUserInfoByIdrpc/{userId}")
    Result<UserInfo> getUserInfoByIdrpc(@PathVariable Long userId){
        UserInfo userInfo = userInfoService.getUserInfoByIdrpc(userId);
        return Result.ok(userInfo);
    }
}
